$(function  () {

    layui.use('form', function(){
        var form = layui.form();
        //监听提交
        form.on('submit(register)', function(data){
              var name = $("#name").val();
              $.ajax({
                url: ipurl+'/role/add',
                data: {
                    name:name
                },
                type: "POST",
                //dataType: "json",
                success:function(results){
                    console.log(results);
                },
                complete: function(data) {
                }
            });
            parent.location.reload(); 
            x_admin_close();
        });
    });

})


